<!DOCTYPE html>
<html>
    <head>
        <title>blog {% block title%}个人博客-静心之地{% endblock %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
        <script type="text/javascript" src="/static/jquery-3.6.0.min.js"></script>
        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script type="text/javascript" src="/static/bootstrap/js/bootstrap.bundle.min.js"></script>
    </head>
    <body background='/static/img/bg.jpeg'>
        <div class="container">
            <div id="left" class="row">
                <div class="col"></div>
    <div id="center" class="col">
            <div class="border" style="margin:150px;background-color:white">

                <div id="topmessage" class="text-center">
                    {% if form.errors %}
                        <p style="color: red;">Your username and password didn't match. Please try again.</p>
                    {% endif %}
                    {% if next %}
                        {% if user.is_authenticated %}
                        <p>Your account doesn't have access to this page. To proceed,
                        please login with an account that has access.</p>
                        {% else %}
                        <p>Please login to see this page.</p>
                        {% endif %}
                    {% endif %}
                </div>
                <div class="justify-content-center">
                    <form method="POST" action="{% url 'login' %}">
                        {% csrf_token %}
                        <table class="table align-middle">
                        <tr>
                            <td>{{ form.username.label_tag }}</td>
                            <td>{{ form.username }}</td>
                        </tr>
                        <tr>
                            <td>{{ form.password.label_tag }}</td>
                            <td>{{ form.password }}</td>
                        </tr>
                        </table>
                    <p class="text-center"><input class="btn btn-success" type="submit" value="login"></p>
                        <input type="hidden" name="next" value="{{ next }}">
                    </form>
                </div>
                <div class="text-center">
                    {# Assumes you set up the password_reset view in your URLconf #}
                    <p><a href="/blog/register/">register</a>&nbsp;|&nbsp;<a href="{% url 'password_reset' %}">Lost password?</a></p>
                </div>
                </div>
    </div>
    <div id="right" class="col"></div>
            </div>
        </div>
        </div>
    </body>
</html>